<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link type="text/css" rel="stylesheet" href="<%=basePath %>statics/css/common/common-1.0.css">
<link type="text/css" rel="stylesheet" href="<%=basePath %>statics/js/plug/jqueryUI/jquery-ui.css">
<link type="text/css" rel="stylesheet" href="<%=basePath%>statics/js/plug/jqPaginator/jqPaginator.css"/>
<link type="text/css" rel="stylesheet" href="<%=basePath%>statics/js/plug/jbox/jBox.css"/>
<link rel="stylesheet" type="text/css" href="<%=basePath%>statics/js/plug/ztree/css/zTreeStyle/zTreeStyle.css">
<link type="text/css" rel="stylesheet" href="<%=basePath %>statics/css/base/baserole/base_role_authority.css">
<script type="text/javascript" src="<%=basePath %>statics/js/plug/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="<%=basePath %>statics/js/plug/jqueryUI/jquery-ui.js"></script>
<script type="text/javascript" src="<%=basePath %>statics/js/plug/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath%>statics/js/plug/jqPaginator/jqPaginator.js"></script>
<script type="text/javascript" src="<%=basePath %>statics/js/plug/jbox/jBox.js"></script>
<script type="text/javascript" src="<%=basePath %>statics/js/common/loading.js"></script>
<script type="text/javascript" src="<%=basePath %>statics/js/common/common-1.0.js"></script>
<script type="text/javascript" src="<%=basePath%>statics/js/plug/ztree/js/jquery.ztree.all-3.5.js"></script>
<script type="text/javascript">
    var pageNumber = ${page.pageNumber};
    var totalCount = ${page.totalCount};
    var pageSize = ${page.pageSize};
    //var isFilter = ${isFilter};//是否通过表单进行查询
</script>
<script type="text/javascript" src="<%=basePath %>statics/js/base/baserole/base_role_authority_list.js"></script>
</head>
<body style="width: 100%;height: 100%;">
	
<div class="window-title-bar">
    <h5 class="title">角色管理</h5>
    <div class="nav">
        <span class="prev-nav">系统管理</span>
        <span class="space">/</span>
        <span class="cur-nav">角色管理</span>
    </div>
</div>

<div class="grid-toolbar">
    <form id="searchForm" action="" method="post">
        <input id="isFilter" type="hidden" name="isFilter" value="${isFilter}">
        <div class="grid-search-item" style="width:95%;">
            <span class="label">角色名称:</span>
            <input type="text" class="input-search" id="roleName" name="roleName" value="${baseRole.roleName}" placeholder="角色名称">
            <button id="searchBtn" type="button" class="btn-icon btn-search"></button>
        </div>
        <!--<div class="grid-search-item">
            <span class="label">用户名:</span>
            <input type="text">
        </div>-->
    </form>
</div>
    
    <shiro:hasPermission name="BaseRole:view">
        <div id="grid-list" class="grid-list" style="overflow-y: auto;">
            <table class="grid-action" cellpadding="0" cellspacing="0">
            <tr>
                <td class="title">
                    结果列表
                </td>
                <td class="action">
                    <ul>
                        <shiro:hasPermission name="BaseUser:create">
                            <li>
                                <button id="addBtn" type="button" class="btn-add">添加</button>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="BaseUser:delete">
                            <li>
                                <button id="deleteBtn" type="button" class="btn-delete">删除</button>
                            </li>
                        </shiro:hasPermission>
                        <li>
                            <button id="refreshCacheBtn" type="button" class="btn-icon btn-refresh">刷新缓存</button>
                        </li>
                    </ul>
                </td>
            </tr>
        </table>
            
            <table id="roleTable" class="list" cellspacing='0' cellpadding="0" width='100%' style="overflow-y: auto;">
                <tr>
                    <th width="50px"><span class="checkbox" id="checkAll"></span></th>
                    <th style="width: 30px;">序号</th>
                    <th style="width: 120px;">角色名称</th>
                    <th style="width: 120px;">角色标识</th>
                    <th style="">基本权限</th>
                    <th style="">菜单查看权限</th>
                    <th style="">菜单操作权限</th>
                    <th style="width:150px;">操作</th>
                </tr>
                <c:forEach var="item" items="${page.items}" varStatus="status">
                    <tr>
                        <td><span id="${item.id}" class="checkbox"></span></td>
                        <td>${status.count}</td>
	                    <td>${item.roleName}</td>
	                    <td>${item.role}</td>
	                    <td title="${item.roleBaseAuthorityName}">${item.roleBaseAuthorityName}</td>
	                    <td title="${item.menuLookAuthorityName}">${item.menuLookAuthorityName}</td>
	                    <td title="${item.menuOperteAuthorityName}">${item.menuOperteAuthorityName}</td>
	                    <td>
                        <ul class="grid-list-action">
                            <shiro:hasPermission name="BaseRole:update">
                                <li><button class="btn-edit" title="编辑" onclick="gridDataEdit('base/role/edit/${item.id}',{dialogId:'updateDialog'})">编辑</button></li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="BaseRole:delete">
                                <li><button  class="btn-delete" title="删除" onclick='gridDataDelete("base/role/delete/${item.id}",{successUrl:"base/role/list/"+currentPageNum+"/24"})'>删除</button></li>
                            </shiro:hasPermission>
                        </ul>
                    </td>
                    </tr>
                </c:forEach>
                 <c:if test="${lastCount > 0}">
                	<c:forEach begin="1" end="${lastCount}" step="1" varStatus="status">
	                     <tr>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
	                    </tr>
                	</c:forEach>
                </c:if>
            </table>
            <div>
                <ul class="pagination" id="pagination"></ul>
            </div>
        </div>
    </shiro:hasPermission>
    
    <shiro:hasPermission name="BaseRole:create">
        <div id="addDialog" title="添加" class="window-inline">
            
        </div>
    </shiro:hasPermission>
    <shiro:hasPermission name="BaseRole:update">
        <div id="updateDialog" title="更新" class="window-inline">

        </div>
    </shiro:hasPermission>
    <div id="loadDiv"></div>
</body>
</html>